home *** CD-ROM | disk | FTP | other *** search
/ Dr. Windows 3 / dr win3.zip / dr win3 / PROGRAMR / WPJV1N7.ZIP / RTFGEN.ZIP / RTFGEN.DOC < prev    next >
Text File  |  1992-02-23  |  17KB  |  595 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.                                                      February 22, 1992
  9.  
  10.                                      RTFGEN
  11.  
  12.                  An ASCII to Rich Text Format Conversion Program
  13.                                    Version 1.0
  14.  
  15.  
  16.         OVERVIEW
  17.  
  18.         Normally, to create a help file with the Windows help compiler, 
  19.         you must first write a help topic file using a Rich Text Format 
  20.         (RTF) word processor.  For many, there are two problems here:
  21.  
  22.           1. RTF word processors are expensive.
  23.           2. Learning to use a new word processor is a nuisance and not
  24.              very productive.
  25.  
  26.         RTFGEN solves both these problems by allowing you to use your 
  27.         favorite ASCII text editor to produce RTF formatted files 
  28.         acceptable to the help compiler.
  29.  
  30.  
  31.         STEPS FOR BUILDING A HELP FILE
  32.  
  33.         The steps required to create a Windows help file using RTFGEN 
  34.         are:
  35.  
  36.           1. Using an ASCII editor, create one or more input text files.  
  37.              The layout of the input files will be discussed later.
  38.           2. Use RTFGEN to convert these files to RTF files.
  39.           3. Create a Help Project File (.HPJ) for input to the help 
  40.              compiler.  This file should reference the RTF files.
  41.           4. Run the help compiler to make the help file.
  42.  
  43.         Steps 3 and 4 are described in the help compiler documentation.  
  44.         This documentation deals with the first two steps only.
  45.  
  46.         Once the ASCII files have been written,  RTFGEN is used to 
  47.         convert them to suitable RTF format.  The file, HEADING, is used 
  48.         in constructing the RTF file and must be present on the default 
  49.         drive.  From the DOS prompt:
  50.  
  51.           RTFGEN  [Infile [Outfile]]
  52.  
  53.         The optional filenames specify the names of the ASCII input file 
  54.         and the RTF file to be generated.  If no extensions are given, 
  55.          .RTF is used by default for the output file.  If the output 
  56.         filename is missing from the command line, an RTF file will be 
  57.         created using the same name as the source file.  When neither 
  58.         filename is specified, names will be requested once execution 
  59.         starts.
  60.  
  61.  
  62.                                    1
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.           RTFGEN MYHELP
  76.  
  77.         will cause RTFGEN to look for a source file, MYHELP, and create 
  78.         an object file, MYHELP.RTF.
  79.  
  80.  
  81.         GENERAL EDITING CONSIDERATIONS
  82.  
  83.         Almost any ASCII editor may be used.  I use Borland's TURBO or 
  84.         TPW.  It's probably best to turn off options like 'optimal fill' 
  85.         which can leave invisible and possibly unknown tab characters in 
  86.         the document.  
  87.  
  88.         The use of tabs is required to obtain column allignment with 
  89.         proportional fonts.  Either the tab character or the RTF command, 
  90.         \tab, may be used with the same effect.
  91.  
  92.         Here are the default conditions use by RTFGEN:
  93.  
  94.              Helv, 10 point font.
  95.  
  96.              Paragraphs are left justified.  The first line is not 
  97.              indented.
  98.  
  99.              Paragraph indentation is set by indentation of the first 
  100.              line of the paragraph.
  101.  
  102.              Tabs are spaced every 720 twips (about 6 default 
  103.              characters).
  104.  
  105.         Any of these defaults may be changed globally for the whole 
  106.         document or locally at the topic, paragraph, or even character 
  107.         level.
  108.  
  109.         RTFGEN and/or the RTF language have special use for the following 
  110.         characters:
  111.  
  112.           `    (grave accent) Used to mark end of paragraphs.
  113.           [,]  Used to mark jumps and definitions.
  114.           {,}  Used to mark areas where font characteristics will change.
  115.           \    Used as a command start character.
  116.  
  117.         When these characters are to be used in the text, they should be 
  118.         preceded by a '\'.  Thus, '\[' will cause the left bracket to be 
  119.         inserted in text and '\\' will result in a single backslash being 
  120.         inserted in text.
  121.  
  122.         (*...*) may be used to insert comments within the text.     
  123.  
  124.  
  125.  
  126.  
  127.  
  128.                                    2
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140.         ASCII INPUT FILE LAYOUT
  141.  
  142.         The input file for RTFGEN should have the following sections:
  143.  
  144.           1. An optional document header.
  145.           2. The command, \docstart, to mark the start of the document.
  146.           3. One or more topics consisting of:
  147.                a. A topic header.
  148.                b. A row of 5 or more '='s marking the start of the topic
  149.                   text.
  150.                c. The topic text.  This is basically the text to be 
  151.                   displayed in the help file.
  152.                d. A row of 5 or more '-'s marking the end of the topic.
  153.           4. The command, \docend, marking the end of the document.
  154.  
  155.           Document Header
  156.  
  157.           The optional document header may contain commands which will be 
  158.           interpreted globally throughout the document.  Commands 
  159.           changing the font, font size, or first line indent might be 
  160.           appropriate here.
  161.  
  162.           The \docstart command follows the document header to mark the 
  163.           start of the topics.
  164.  
  165.              Example:
  166.  
  167.              \f0 \fs24  (*Times Roman font, 12 pitch for entire file*)
  168.              \docstart
  169.  
  170.           Topic Header
  171.  
  172.           The topic header contains commands defining build tags, context 
  173.           strings, title, keywords, and browse sequence number as 
  174.           appropriate for the topic.  Topic global formatting commands 
  175.           may also be included.  The topic header section is terminated 
  176.           with a row of 5 or more '='s.
  177.  
  178.              Example:
  179.  
  180.              \title Table of Contents`
  181.              \topic contents`
  182.              \keyword contents`
  183.              \f0 \fs24   (* Times Roman font, 12 pitch for this topic *)
  184.              ============  (* end of topic header *)
  185.  
  186.           Topic Text
  187.  
  188.           Text for the topic is entered here.  Rules for text entry are:
  189.  
  190.              Paragraph ends are marked with a grave accent, '`'
  191.  
  192.  
  193.  
  194.                                    3
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.  
  206.              Blank lines will appear as blank lines.
  207.  
  208.              By default, paragraphs are left justified.  The indenting of 
  209.              the paragraph is set by the indenting of the first line of 
  210.              the paragraph.  Indenting of lines after the first is 
  211.              ignored.
  212.  
  213.              Carriage returns and linefeeds within the paragraph are 
  214.              ignored as far as the final results are concerned.
  215.  
  216.              Commands may be interspersed within the text for special 
  217.              effects.  The commands themselves won't appear in the final 
  218.              result.
  219.  
  220.              Examples:
  221.  
  222.              |   Here is a typical paragraph.  It will appear in the font
  223.              |   and pitch specified in the topic header or document 
  224.              |   header.  It is left justified and indented by 360 twips
  225.              |   because the first line is so indented.  The paragraph
  226.              |   is terminated with a grave accent character.`
  227.  
  228.              |   \b\fi480 Here is another paragraph.  It will appear in
  229.              |   bold font because of the \b command.  It will also be
  230.              |   be indented by 360 twips and left justified.  The 
  231.              |   \fi480 will cause the first line of the paragraph
  232.              |   to be indented an additional 480 twips.`
  233.  
  234.  
  235.  
  236.         COMMAND SYNTAX
  237.  
  238.         Commands for RTFGEN and RTF commands passed thru to the help 
  239.         compiler have a similar syntax.  Commands start with a backslash 
  240.         followed by a LOWERCASE alpha symbol.  Some RTF commands 
  241.         have a numerical value attached.  Some RTFGEN commands have an 
  242.         additional parameter string.
  243.  
  244.           Examples:
  245.  
  246.           \box
  247.           \topic <topic name>
  248.           \fs24          RTF command with number
  249.           \fi-720        '-' sign may be used if appropriate
  250.  
  251.         When commands are mixed with t